package com.quectel.core.module.propertybill.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.quectel.constant.pay.PayBusinessType;
import com.quectel.core.module.household.dto.HouseholdDto;
import com.quectel.core.module.propertybill.vo.PropertyBillAmountVo;
import com.quectel.core.module.village.dto.VillageRoomDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @author zhangheng
 * @email nolan.zhang@quectel.com
 * @date 2023/03/31 16:28
 */
@Data
@Schema
public class PropertyBillDto implements Serializable {

    /**
     * id
     */
    @Schema(description = "id")
    private Long id;

    /**
     * 租户id
     */
    @Schema(description = "租户id")
    private Long tenantId;

    /**
     * 小区id
     */
    @Schema(description = "小区id")
    private Long villageId;

    /**
     * 楼栋Id
     */
    @Schema(description = "楼栋Id")
    private Long buildingId;

    /**
     * 楼层Id
     */
    @Schema(description = "楼层Id")
    private Long floorId;

    /**
     * 房间id
     */
    @Schema(description = "房间id")
    private Long roomId;

    /**
     * 支付人id
     */
    @Schema(description = "支付人id")
    private Long householdId;

    /**
     * 收费标准id
     */
    @Schema(description = "收费标准id")
    private Long chargeableListId;

    /**
     * 1按月2按季度3半年4按年
     */
    @Schema(description = "1按月2按季度3半年4按年")
    private Byte periodType;

    /**
     * 账单所在年
     */
    @Schema(description = "账单所在年")
    private Integer year;

    /**
     * 对于月取值范围1-12 季度取值范围1-4 对于半年取值范围1-2 年存入1
     */
    @Schema(description = "对于月取值范围1-12 季度取值范围1-4 对于半年取值范围1-2 年存入1")
    private Integer periodValue;

    /**
     * 周期名称 2023第一季度xxx账单
     */
    @Schema(description = "周期名称 2023第一季度xxx账单")
    private String periodName;

    /**
     * 通用订单Id
     */
    @Schema(description = "通用订单Id")
    private Long orderId;

    /**
     * 物业账单编号支付成功产生
     */
    @Schema(description = "物业账单编号支付成功产生")
    private String orderNo;

    /**
     * 应缴总额
     */
    @Schema(description = "应缴总额")
    private BigDecimal totalAmount;

    /**
     * 项目总金额
     */
    @Schema(description = "项目总金额")
    private BigDecimal itemAmount;

    /**
     * 优惠总金额
     */
    @Schema(description = "优惠总金额")
    private BigDecimal discountAmount;

    /**
     * 滞纳金
     */
    @Schema(description = "滞纳金")
    private BigDecimal overdueAmount;

    /**
     * 实缴金额
     */
    @Schema(description = "实缴金额")
    private BigDecimal payAmount;


    /**
     * 开票状态0未提交开票 1申请开票,开票中2已开票3已红冲4已关闭
     */
    @Schema(description = "开票状态0未提交开票 1申请开票,开票中2已开票3已红冲4已关闭")
    private Byte invoiceStatus;


    /**
     * 最后一次创建订单时间
     */
    @Schema(description = "最后一次创建订单时间")
    private Date latestCreateOrderTime;

    /**
     * 支付状态1未支付2已支付3已退款
     */
    @Schema(description = "支付状态1未支付2已支付3已退款")
    private Byte payStatus;

    /**
     * 支付时间
     */
    @Schema(description = "支付时间")
    private Date payTime;

    /**
     * 赠品领取状态 1已领取 0未领取
     */
    @Schema(description = "赠品领取状态")
    private Byte giftFlag;

    /**
     * 赠品数量
     */
    @Schema(description = "赠品数量")
    private Integer giftNum;

    /**
     * 逾期缴费时间
     */
    @Schema(description = "逾期缴费时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date overdueDate;

    /**
     * 逾期天数
     */
    @Schema(description = "逾期天数")
    private Long overdueDays;

    /**
     * 账单开始时间
     */
    @Schema(description = "账单开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startDate;

    /**
     * 账单结束时间
     */
    @Schema(description = "账单结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endDate;

    /**
     * 账单创建时间
     */
    @Schema(description = "账单创建时间")
    private Date createTime;

    /**
     * 账单更新时间
     */
    @Schema(description = "账单更新时间")
    private Date updateTime;

    /************非数据库字段 start ************/
    /**
     * 业务类型
     */
    @Schema(description = "业务类型")
    private String businessType = PayBusinessType.PROPERTY_BILL;

    /**
     * 物业公司信息
     */
    @Schema(description = "物业公司名称")
    private String propertyInfoName;

    /**
     * 房间
     */
    @Schema(description = "房间")
    private VillageRoomDto villageRoom;

    /**
     * 收费标准名称
     */
    @Schema(description = "收费标准名称")
    private String chargeableListName;

    /**
     * 业主姓名
     */
    @Schema(description = "业主姓名")
    private String ownerName;

    /**
     * 业主电话
     */
    @Schema(description = "业主电话")
    private String ownerMobile;

    /**
     * 缴费住户
     */
    @Schema(description = "缴费住户")
    private HouseholdDto household;

    /**
     * 逾期状态0未逾期1逾期
     */
    @Schema(description = "逾期状态")
    private Byte overdueStatus;

    @Schema(description = "账单详情")
    private PropertyBillAmountVo propertyBillAmount;

    /**
     * 活动标识 0没有活动 1有活动
     */
    @Schema(description = "活动标识 0没有活动 1有活动")
    private Byte activityFlag;


    /************非数据库字段 end **************/
}
